package cn.wxrobot.demo;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

public class Test {

	private static List<String> set1 = new ArrayList<String>();
	private static Set<String> set2 = new HashSet<String>();
	
	static {
		set1.add("A");
		set1.add("B");
		set1.add("C");
		set1.add("D");
		set1.add("E");
		set1.add("F");
		
		set2.add("A");
		set2.add("B");
	}
	
	public static void main(String[] args) {
		Iterator<String> it =  set1.iterator();
		while (it.hasNext()) {
			System.out.println("------------------");
			String path = (String) it.next();
			System.out.println(path);
			//1.判断
			System.out.println("已处理集合："+set2.toString());
			boolean isc = set2.contains(path);
			//2.如果已处理，跳过
			if(isc){
				System.out.println("已经处理："+path);
				continue;
			}
			
			//2.如果未处理，处理
			System.out.println("处理。。。。。。处理完");
			//3.处理完了，放入处理完的列表里
			set2.add(path);
		}

	}

}
